/**
 * @date 2006-7-18
 */

package org.nanhill.xmlro.gsp;

import java.io.IOException;
import java.util.Map;

import org.nanhill.xmlro.gsp.client.DefaultGspAgent;
import org.nanhill.xmlro.gsp.client.GspAgent;

/**
 * @author alin [xalinx at gmail dot com]
 * @date 2006-7-18
 */
public class GetClassesSample {

	private static long getRetcode(Map result) {
		Map map = (Map) result;
		return (Long) map.get("retcode");
	}

	/**
	 * @param args
	 * @throws GspException
	 */
	public static void main(String[] args) {
		GspAgent importAgent = new DefaultGspAgent("hawaii.kernel.sls");
		try {
			importAgent.addSLSTarget("192.168.6.12", 2001);
			importAgent.setServiceType("centaurus.dbservice", "1");
			importAgent.locate();
			Map result = (Map) importAgent.doService("getClasses", null);
			System.out.println(getRetcode(result));
			importAgent.close();
		} catch (GspException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}
}
